package com.um.jdy.platform.month.manager;

import com.um.jdy.platform.month.entity.dto.CardPackagePageDTO;
import com.um.jdy.platform.month.entity.vo.CardPackageItemVO;
import com.um.jdy.platform.recharge.entity.vo.RechargeOrderItemVO;
import com.um.springboot.starter.entity.Page;
import com.um.springboot.starter.orm.entity.Response;
import com.um.springboot.starter.orm.manager.BasePlusManager;
import com.um.springboot.starter.orm.params.ListDTO;
import com.um.springboot.starter.orm.params.PageDTO;
import com.um.jdy.common.month.service.CardPackageService;
import com.um.jdy.common.month.entity.po.CardPackage;
import com.um.jdy.common.month.entity.dto.CardPackageDTO;
import com.um.jdy.common.month.entity.vo.CardPackageVO;
import com.um.springboot.starter.orm.params.PageParams;
import org.springframework.stereotype.Component;

/**
 * 管理类：月卡套餐表
 */
@Component
public class CardPackageManager extends BasePlusManager<CardPackageService,CardPackage,CardPackageDTO,CardPackageVO, CardPackagePageDTO, ListDTO> {

    /**
     * 分页查询订单
     * @param pageParams
     * @return
     */
    public Response<Page<CardPackageItemVO>> getPage(PageParams pageParams) {
        Page<CardPackageItemVO> page = new Page<>();
        page.setPageNo(pageParams.getPageNo());
        page.setPageSize(pageParams.getPageSize());

        pageParams.getCondition().put("p.com_id",getComId());

        page = service.getCMSViewModelPageBySqlName(page, "get_monthcard_package_page", "get_monthcard_package_count",
                CardPackageItemVO.class, pageParams.getProperties(), pageParams.getValues(),
                pageParams.getRangeEntitys(), pageParams.getOrderNames(), pageParams.getSortOns());
        return Response.success(page);
    }

}
